<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>事件学习</title>
</head>
<body>
<div id="app">
    <h1>{{message}}</h1>
    <button v-on:click="sayHi()">{{name}}</button>
    <button @click="sayHello">{{name}}</button>
</div>
<script src="vue.js"></script>
<script>
    let vm = new Vue({
        el: "#app",
        data: {
            message: "事件绑定学习",
            name: "按钮"
        },
        methods: {
            sayHi() {
                console.log("Hi~");
            },
            sayHello() {
                console.log("Hello!");
            }
        }
    })
</script>
</body>
</html>